package com.lv.drawable.drawable

import android.graphics.drawable.GradientDrawable
import android.graphics.drawable.RippleDrawable
import android.graphics.drawable.StateListDrawable

fun shape(shape: Shape = Shape.RECTANGLE, builder: ShapeBuilder.() -> Unit): GradientDrawable {
    val build = ShapeBuilder(shape)
    build.builder()
    return build.build()
}

/**
 * 设置press等状态 click等状态需要设置 View.setClickable(true)
 */
fun selector(builder: SelectorBuilder.() -> Unit): StateListDrawable {
    val build = SelectorBuilder()
    build.builder()
    return build.build()
}

fun ripple(builder: RippleBuilder.() -> Unit): RippleDrawable {
    val build = RippleBuilder()
    build.builder()
    return build.build()
}